<template>
  <div>
    <a-row :gutter="24">
      <a-col :xl="8" :lg="24" :md="24" :sm="24" :xs="24">
        <a-card :loading="loading" title="添加菜单" :bordered="false">
          <menus-add
            ref="menusAdd"
            @parentFn1="menusListRefresh"
          />
        </a-card>
      </a-col>
      <a-col
        style="padding: 0 12px"
        :xl="16"
        :lg="24"
        :md="24"
        :sm="24"
        :xs="24">
        <a-card title="所有菜单" style="margin-bottom: 24px" :bordered="false">
          <menus-list
            ref="menusList"
            @parentFn2="menusAddGetData"
          />
        </a-card>
      </a-col>
    </a-row>
  </div>
</template>

<script>
import menusAdd from './menusAdd'
import menusList from './menusList'
export default {
  name: 'Menus',
  components: {
    menusAdd,
    menusList
  },
  data () {
    return {
      loading: false
    }
  },
  methods: {
    menusListRefresh () {
      this.$refs.menusList.frush()
    },
    menusAddGetData (param) {
      var id = param.id
      var type = param.type
      this.$refs.menusAdd.edit(id, type)
    }
  }
}
</script>

<style scoped>

</style>
